-- @owner: @zhangbingliang
-- @date: 2025-07-31
-- @testpoint: A库使用fetch_status函数测试，合理报错
-- @modify: modified by @zhangbingliang at 2025-07-31

--step1:连接A库
@conn PrimaryDbAmode;

--step2:创建空表
drop table if exists t_fetch0012;
CREATE TABLE t_fetch0012 (ID INT);

--step3:调用游标后使用fetch_status函数查询;expect:报错
begin; /
DECLARE cur_fetch0012 CURSOR FOR SELECT ID FROM t_fetch0012; /
FETCH NEXT FROM cur_fetch0012;
select @@FETCH_STATUS; 
CLOSE cur_fetch0012;
end;

--step4:清理环境
drop table if exists t_fetch0012;